var Devices = require('./devices').Devices;

var Insert = function(user_key, device_imei, device_type) {
	console.log(user_key);
	var _userkey = {userkey: user_key, devicetype: device_type};
	var update = {deviceimei: device_imei};
	var options    = {upsert : true};
	var callback = function(err) {
		if(err) {
			console.log('insert err:' + err);
		} else {
			console.log('insert success');
		}
	}

	Devices.Insert(_userkey, update, options, callback);
}

exports.Insert = Insert;


